﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListSelect.aspx.cs" Inherits="Bingosoft.WebApp.Modules.SecurityConsole.Common.FunctionControl.TreeListSelect.ListSelect" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="Bingosoft.Modules.SecurityConsole.Common.Helper" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript">
    var Global = {};
    Global.contextPath = '<%= RequestHelper.GetContextPath(Request) %>';
</script>
<head runat="server">
    <title></title>
        <web:Script ID="Script1" src="~/Scripts/jquery.js" runat="server" />
        <web:Script ID="Script2" src="~/Scripts/jquery.utils.js" runat="server" />
        <web:Script ID="Script3" src="~/Scripts/jquery_plugins/jquery.json.js" runat="server" />
        <link rel="stylesheet" type="text/css" href="TreeListSelect.css" />
        <script type="text/javascript" src="ListSelect.js"></script>
</head>
<script type="text/javascript">
    function init() {
        if (tempValue.length > 0) {
            document.getElementById("cur_page_values").value = tempValue.substr(1, tempValue.length);
            document.getElementById("cur_page_texts").value = tempText.substr(1, tempText.length);
        }
        //重新设置用户列表的值
        window.parent.userTreeObject.resetPage(document.getElementById("cur_page_values").value, document.getElementById("cur_page_texts").value);
        //重新初始化checkbox 
        window.parent.userTreeObject.initSelection(window.parent.document.getElementById("selectedPerson")); //重新设置checkbox

        var singleMode = '<%= Request["selectMode"]%>';
        if (singleMode && singleMode == "single") {
            document.getElementById("ck_title").style.display = "none";
        }
    }

    function checkAll(checked) {
        window.parent.checkAllElement(checked);
    }

    function over(obj) {
        obj.style.backgroundColor = '#eaf1ff';
    }

    function out(obj) {
        obj.style.backgroundColor = '#FFFFFF';
    }
	</script>
	<body onload="init()">		
		<table cellpadding="0" cellspacing="1" class="dg_borderstyle"
			style="width: 100%">
			<th width="5%">
				<input id="ck_title" type="checkbox" name="ck_title" value="ck_title"
					onClick="checkAll(this.checked)" />
			</th>
				<th width="20%">
					名称
				</th>
				<th width="25%">
					帐号
				</th>
                <th width="25%">
					部门
				</th>
				<th width="25%" style="text-align: left; padding-left: 25px">
					手机号码
				</th>
			<%--保存当前页的所有的值,为全选设置 --%>
			<input type="hidden" name="cur_page_values" id="cur_page_values"
				value="" />
			<input type="hidden" name="cur_page_texts" id="cur_page_texts"
				value="" />
			<script>
			    var tempValue = '';
			    var tempText = '';
			</script>
            <% foreach (IDictionary<string, object> item in dataList)
               {%>
				<tr class="dg_alternatingitemstyle" onmouseover="over(this)" onmouseout="out(this)">
					<td>
						<input type="checkbox" name="ck_box" id="ck_<%=item["ID"] %>"
							onClick="window.parent.userTreeObject.changeThis(this.checked, '<%=item["ID"] %>', '<%=item["NAME"] %>[<%=item["DEP"] %>]');" style="margin-left: 2px"/>
					</td>
					<td>
						<%=item["NAME"] %>
					</td>
                    <td>
						 <%=item["ACCOUNT"]%>
					</td>
					<td>
                        <%=item["DEP"]%>
					</td>
					<td style=" padding-left: 15px;width: 25%">
                        <%=item["MOBILE"]%>
					</td>
				</tr>
				<script>
				    tempValue += "," + '<%=item["ID"] %>';
				    tempText += "," + '<%=item["NAME"] %>' + '[<%=item["DEP"]%>]';
				</script>
                <%
               }
                 %>
		</table>

	</body>
</html>
